1. Technological Field
This invention relates to cache synchronization and more particularly relates to synchronizing cascading caches within a multi-tier environment.
2. Background Technology
In a client-server environment, it is common for a client to cache data that is owned by the server. In other words, the client stores a copy of data from the server on, for example, random access memory (RAM), such as local RAM, that is coupled to the client. In this way, the client can access and modify this cached data locally without requiring communication across a network or other communication channel in order to access the data remotely at the server. The time, processor, and network traffic savings can result in a significant increase in performance of the client-server system.
When the client caches data from the server, the server typically prevents other clients or applications from removing or modifying the data on the server. The client, in one sense, checks out the data from the server and the server may prevent other clients from interrupting that access. In some situations, however, it may be useful to call back the data from the client in order to fulfill a data access request from another client. For example, if another client requires access to the same data, the server may request that the first client synchronize its cached data with the server. In a typical synchronization operation, the client sends the cached data, including any modifications, back to the server and discontinues caching the data locally. The server then has the most recent data available. Sending the cached, modified data back from the client to the server may be referred to as flushing the data back to the server.
In order to prevent a client application or other user from further modifying the cached data while the client flushes the data back to the server, the client conventionally locks the cached data in response to the synchronization call from the server and throughout the synchronization operation. The client releases the lock, or unlocks the cache, only when the cache flush is complete. The client typically responds to the synchronization call-back to notify the server that the synchronization is complete.
The conventional synchronization technology can halt an entire system when applied to a multi-tier system in which cascaded caching and synchronization are present. One example of a multi-tier architecture or environment is an enterprise application running in an application/database server on top of a database/file server. FIG. 1 depicts a conventional synchronization deadlock within a multi-tier system. A simple multi-tier system includes three nodes, which may be referred to as nodes A, B, and C. Nodes A and B form a first client-server relationship and, similarly, nodes B and C form a second client-server relationship at a downstream level. Node B, acting as a client of node A may cache data from node A. Subsequently, node C, acting as a client of node B, may cache data from node B, including some or all of the data originally obtained by node B from node A.
When node A receives a data access request from another client, node A, acting as a server, may request that node B, acting as a client, synchronize (flush back) its cached data. Conventionally, node B locks its cache in response to the synchronization request from node A. With the cache coupled to node B locked, the data cached by node B is unavailable for any modifications. However, node B, acting as a server, recognizes that some of the data that is requested by node A has been cached downstream by node C, acting as a client. Node B, therefore, sends a synchronization request to node C.
Unfortunately, node C cannot flush back its cached data to node B because node B has locked its cache in response to the synchronization request from node A. In this scenario, the entire system may deadlock while node A waits for node B to flush back, node B waits for node C to flush back, and node C waits for node B to unlock its cache so node C can flush back.
One specific example of this problem is apparent in a system where node A is a Storage Area Network (SAN) File System meta-data server, node B is an IBM® TotalStorage SAN File System client to node A, node B also acts as a Common Internet File System (CIFS) server, and node C is a CIFS client to node B. The potential for system deadlock increases substantially if node B supports the CIFS Oplocks protocol, which uses an inverted-locking model that considers locks granted while corresponding synchronization requests are pending.
Multi-phase commit protocols, such as two phase commit, exist and are used within the distributed transaction and protocol environments. However, these protocols are used only for distributed agreement, voting, and potentially locking within a cluster or single-tier or two-tier systems. Multi-phase commit protocols have not been implemented within multi-tier systems having more than two tiers.
From the foregoing discussion, it should be apparent that a need exists for an apparatus, system, and method for cache synchronization within a multi-tier environment. Beneficially, such an apparatus, system, and method would overcome the present synchronization challenges that allow synchronization deadlocks.